/**
 * FIFS - The Find It File System
 * Copyright (C) 2006 Chris Oklota (chris at oklota dot net)
 * 
 * This program is distributed under the terms of the GNU LGPL.
 * See the file http://www.gnu.org/licenses/lgpl.txt
 */
package fifs;

import java.util.HashSet;
import java.util.Set;

import fuse.FuseStat;

/**
 * This class represents a file in the fifs.
 */
public class FifsFile {

    /** The name of the file */
    private String filename;

    /** The unique file handle */
    private long fh;
    
    /** The set of tags associated with this file */
    private Set<String> tags = new HashSet<String>();

    /** The file attributes */
    private FuseStat attributes;
    
    /** Flag indicating if the file was modified since it was opened */
    private boolean dirty = false;
    
    /**
     * Constructor for a file
     */
    public FifsFile() {
        
    }

    public FuseStat getAttributes() {
        return attributes;
    }

    public void setAttributes(FuseStat attributes) {
        this.attributes = (FuseStat)attributes.clone();
    }

    public long getFh() {
        return fh;
    }

    public void setFh(long fh) {
        this.fh = fh;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public Set<String> getTags() {
        return tags;
    }

    public void setTags(Set<String> tags) {
        this.tags.addAll(tags);
    }

    public boolean isDirty() {
        return dirty;
    }

    public void setDirty(boolean dirty) {
        this.dirty = dirty;
    }
    
    

    
}
